import React from 'react';
import PropTypes from 'prop-types';

const Hidden = props => {
  const { disabled, children } = props;
  if (!children) {
    return null;
  }
  if (disabled) {
    return <>{children}</>;
  }

  return <div style={{ display: 'none' }}>{children}</div>;
};

Hidden.propTypes = {
  disabled: PropTypes.bool,
};

Hidden.defaultProps = {
  disabled: false,
};

export default Hidden;
